package cn.sofwin.day0201.homework;

public class H3 {
    public static void main(String[] args) {
        String str = "goOd gooD stUdy dAy dAy up";
        char[] chars = str.toCharArray();

        // 第一个字母
        if (chars[0] <= 122 && chars[0] >= 97){
            chars[0] = (char) (chars[0] - 32);
        }

        // 后面的
        for (int i = 1; i < chars.length; i++) {
            if (' ' == chars[i]){
                i++;
                chars[i] = (char) (chars[i] - 32);
                continue;
            }
            if (chars[i] <= 90 && chars[i] >= 65){
                chars[i] = (char)(chars[i] + 32);
            }
        }

        System.out.println(chars);
    }
}
